package com.itheima.controller;

import com.itheima.domain.Items;
import com.itheima.domain.Orders;
import com.itheima.domain.User;
import com.itheima.mapper.UserMapper;
import com.itheima.utils.MapperUtil;
import org.apache.ibatis.session.SqlSession;
import org.junit.Test;

import java.util.List;

/**
 * @param
 * @return
 */
public class otmTest {
    @Test
    public void findAll(){
        //老一套，工具类获取session
        SqlSession session = MapperUtil.getSession();
        //session获取接口代理对象
        UserMapper mapper = session.getMapper(UserMapper.class);
        //调用接口中的方法
        List<User> list = mapper.findAll();
        //处理结果
        for (User user : list) {
            System.out.println("user = " + user);
        }
    }
}
